ssc install estout, replace

cd .

use "institutionlevel.dta", clear
gen gdp_pc_log = log10(gdp_pc)
gen ctrpop_log = log10(ctrpop)

* This code replicates the results in Appendix Section A.4 

* Model 1
eststo: quietly logit has_polisci_division i.bin age num_divisions_log, cl(cowcode)

* Model 2
eststo: quietly logit has_polisci_division i.bin age num_divisions_log gdp_pc_log ctrpop_log, cl(cowcode)

esttab using m1_logit.tex, booktabs replace
eststo clear

* This code replicates the results in Appendix Section B.3 

* Model 1 (Autocratic)
eststo: quietly clogit has_polisci_division distrank i.public num_divisions_log if bin==1, group(cowcode) cl(cowcode)

* Model 2 (Hybrid)
eststo: quietly clogit has_polisci_division distrank i.public num_divisions_log if bin==2, group(cowcode) cl(cowcode)

* Model 3 (Democratic, need to exclude the US)
eststo: quietly clogit has_polisci_division distrank i.public num_divisions_log if bin==3 & cowcode != 2, group(cowcode) cl(cowcode)

esttab using m2_logit.tex, booktabs replace
eststo clear
